@include b(chat-toolbar-item) {
  position: relative;
  display: flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;

  @include e(content) {
    display: flex;
    align-items: center;
    white-space: nowrap;

    @include m(icon) {
      display: flex;
      flex-shrink: 0;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      font-size: 18px;
    }

    @include m(label) {
      display: flex;
      align-items: center;
    }
  }

  @include e(more) {
    display: flex;
    align-items: center;

    @include m(icon) {
      font-size: 18px;
    }
  }
}

@include b(chat-toolbar-item-default) {
  width: fit-content;
  font-size: 14px;
  color: #{getCssVar('ai-chat', 'color-2')};

  .#{bem(chat-toolbar-item, content)} {
    z-index: 9;
    gap: 6px;
    padding: 2px 14px;
    line-height: 28px;
    background-color: #{getCssVar('ai-chat', 'background-color-2')};
    border-radius: 12px;
  }

  @include when(disabled) {
    cursor: not-allowed;
    .#{bem(chat-toolbar-item, content)},
    .#{bem(chat-toolbar-item, more)} {
      background-color: #{getCssVar('ai-chat', 'disabled-color')};
    }
  }

  &:not(.is-disabled) {
    .#{bem(chat-toolbar-item, content)},
    .#{bem(chat-toolbar-item, more)} {
      &:hover {
        background-color: #{getCssVar('ai-chat', 'hover-background-color-2')};
      }
    }
  }

  @include when(more) {
    .#{bem(chat-toolbar-item, content)} {
      padding: 2px 8px 2px 14px;
      border-radius: 12px 0 0 12px;
    }
  }

  .#{bem(chat-toolbar-item, more)} {
    z-index: 9;
    height: 32px;
    padding: 2px 14px 2px 8px;
    background-color: #{getCssVar('ai-chat', 'background-color-2')};
    border-left: 1px solid #{getCssVar('ai-chat', 'border-color')};
    border-radius: 0 12px 12px 0;
  }
}

@include b(chat-toolbar-item-circle) {
  max-width: 32px;
  height: 32px;
  padding: 6px;
  overflow: hidden;
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid #{getCssVar('ai-chat', 'border-color')};
  border-radius: 15px;
  transition: max-width 0.8s ease;

  @include when(disabled) {
    color: #{getCssVar('ai-chat', 'disabled-color')};
    cursor: not-allowed;
  }

  &:hover:not(.is-disabled) {
    max-width: 200px;
    color: #{getCssVar('ai-chat', 'hover-color')};
    background-color: #{getCssVar('ai-chat', 'hover-background-color')};
  }

  .#{bem(chat-toolbar-item, content, label)} {
    width: calc(100% - 32px);
    margin-left: 8px;
    font-size: 14px;
  }
}

@include b(chat-toolbar-item-dropdown) {
  position: absolute;
  right: 0;
  bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 150px;
  padding: 4px;
  background-color: #{getCssVar('ai-chat', 'background-color-2')};
  border-radius: 6px;

  @include e(item) {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 0 8px;
    line-height: 32px;
    cursor: pointer;
    border-radius: 6px;

    @include when(disabled) {
      cursor: not-allowed;
      background-color: #{getCssVar('ai-chat', 'disabled-color')};
    }

    &:hover:not(.is-disabled) {
      background-color: #{getCssVar('ai-chat', 'hover-background-color-2')};
    }

    @include m(icon) {
      display: flex;
      flex-shrink: 0;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      font-size: 18px;
    }

    @include m(label) {
      flex-grow: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}
